package jpf.nextsearch.ds.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * @author <a href="mailto:jacek.pruszkowski@gmail.com">Jacek Pruszkowski</a>
 */
@Entity
@Table(name = "HOST")
public class HostVO {
	public static final int IP_MAX_LENGTH = 4 * 3 + 3;

	@Id
	@SequenceGenerator(name = "HOST_SEQ", sequenceName = "HOST_SEQ", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HOST_SEQ")
	private Long id;

	@Column(name = "ip", nullable = false, length = IP_MAX_LENGTH)
	private String ip;

	@Column(name = "scan_date")
	private Date scanDate;

	@Column(name = "import_date", nullable = false)
	private Date importDate;

	@Column(name = "available", nullable = false)
	private Boolean available;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Date getScanDate() {
		return scanDate;
	}

	public void setScanDate(Date scanDate) {
		this.scanDate = scanDate;
	}

	public void setImportDate(Date importDate) {
		this.importDate = importDate;
	}

	public Date getImportDate() {
		return importDate;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}

	public Boolean getAvailable() {
		return available;
	}

	public String toString() {
		return getIp();
	}

}
